<?php include(APPLICATION_PATH.'modules/hm-poll/views/scripts/common/navigation.phtml'); ?>
<h2 class="title">Respostas</h2>
<form enctype="multipart/form-data" action="<?php echo $this->url(array('action'=>'add-answer')); ?>" method="post">
	<div class="clear">
		<div class="span-2 append-bottom"><label for="source">Resposta:</label></div>
		<input type="text" name="answer" tabindex="1" maxlength="255" class="span-6 append-bottom" />
	</div>
	<div class="clear"><input type="submit" tabindex="2" name="add" value="Cadastrar" /></div>
</form>

<hr />

<table>
	<thead>
		<tr class="box">
			<td>Resposta</td>
			<td>Votos</td>
			<td></td>
		</tr>
	</thead>
	<tfooter></tfooter>
	<tbody>
		<?php foreach($this->list_answer as $list_answer) : ?>
			<tr>
				<td><?php echo $list_answer['answer']; ?></td>
				<td><?php echo $list_answer['votes']; ?></td>
				<td>
					<a href="<?= $this->url(array('action'=>'delete-answer','answer_id'=>$list_answer['id'])) ?>">Excluir</a>
				</td>
			</tr>
		<?php endforeach; ?>
	</tbody>
</table>